<?php namespace dmq;

abstract class Model
{
	protected $db;	// (Database).

	final public function __construct( $useDb )
	{
		$this->db = false;

		if ( $useDb )
		{
			require_once Settings::DMQ_PATH . 'Database.php';
			$this->db = new Database();
			$this->db->open();
		}
	}

	final public function __destruct()
	{
		if ( $this->db )
		{
			$this->db->close();
		}
	}
}
